
import { defineStore } from 'pinia'
import { store } from "@/stores";

const useOrderStore = defineStore({
  id: "order",
  state: () => ({
    spec: <any[]>[],
    charges: <any[]>[],
    productId: '',
  }),
  actions: {
    async setOrder(spec, charges, productId) {
      this.productId = productId
      this.spec = spec;
      this.charges = charges;
    }
  },
  persist: true,
})

export function useOrderStoreHook() {
  return useOrderStore(store);
}
